import styles from './index.less';
import { Menu, Dropdown } from 'antd'
import React from 'react';
import { Link } from 'umi';

const CommonHerder = () => {
    //退出登录
    const quit = () => {
        localStorage.removeItem('token')
        localStorage.removeItem('user')
    };
    const menu = (
        <Menu>
            <Menu.Item>
                <Link to='/ownspace'>个人中心</Link>
            </Menu.Item>
            <Menu.Item>
                <Link to='/user'>用户管理</Link>
            </Menu.Item>
            <Menu.Item>
                <Link to='/setting'>系统设置</Link>
            </Menu.Item>
            <Menu.Item>
                <Link onClick={quit} to='/login'>退出登录</Link>
            </Menu.Item>
        </Menu>
    );
    return <div className={styles.header}>
        <div className={styles.header_top}>
            <i></i>
            <Dropdown overlay={menu} placement="bottom">
                <p className={styles.header_top_p}>
                    <span className={styles.images}></span>
                    <span className={styles.header_top_p_user}>Hi,admin</span>
                </p>
            </Dropdown>

        </div>
    </div>
}
export default CommonHerder